package com.baidu.disk.utils;

import com.baidu.disk.bean.RequestBean;
import org.jsoup.Connection;
import org.jsoup.Jsoup;


/**
 * Created by CJ on 2018-02-27.
 */
public class JsoupUtils {

    private static  Connection conn = null;

    public static Connection getConnection(RequestBean requestBean){

         conn = Jsoup.connect(requestBean.getUrl())
                .timeout(10000)
                .ignoreContentType(true)
                .header("Cookie", requestBean.getCookie());

        //请求中额外参数
        if(requestBean.getData() != null)
            conn.data(requestBean.getData());

        return conn;
    }



}
